{extend name="base" /} {block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">推广标题</li>
            <li class="">
                <a href="{:url('admin/title/add')}">添加标题</a>
            </li>
        </ul>
        <div class="layui-tab-content">

            <form class="layui-form layui-form-pane" action="{:url('admin/title/index')}" method="get">
                <div class="layui-inline">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-inline">
                        <select name="cid">
                            <option value="0">全部</option>
                            {foreach name="imgcategory_level_list" item="vo"}
                            <option value="{$vo.id}" {if condition="$cid==$vo.id" } selected="selected" {/if}>{neq name="vo.level" value="1"}|{php}for($i=1;$i
                                <$vo[ 'level'];$i++){echo ' ----';}{/php}{/neq}
                                    {$vo.name}</option>
                                    {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">关键词</label>
                    <div class="layui-input-inline">
                        <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
            </form>
            <hr>

            <form action="" method="post" class="ajax-form">
                <button type="button" class="layui-btn layui-btn-small ajax-action" data-action="{:url('admin/title/toggle',['type'=>'audit'])}">审核通过</button>
                <button type="button" class="layui-btn layui-btn-warm layui-btn-small ajax-action" data-action="{:url('admin/title/toggle',['type'=>'cancel_audit'])}">审核拒绝</button>
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                            <tr>
                                <th style="width: 15px;">
                                    <input type="checkbox" class="check-all">
                                </th>
                                <th style="width: 30px;">ID</th>
                                <th>标题</th>
                                <th style="width: 200px;">发布时间</th>
                                <th style="width: 60px;">审核状态</th>
                                <th style="width: 90px;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach name="title_list" item="v"}
                            <tr>
                                <td>
                                    <input type="checkbox" name="ids[]" value="{$v.id}">
                                </td>
                                <td>{$v.id}</td>
                                <td>
                                    <div style="display: flex;">
                                        <div style="flex: 1;">
                                            <img style="width:100%;" src="{$v.path}" alt="">
                                        </div>
                                        <div style="flex: 4;padding: 0 15px;font-size: 12px;overflow: hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;">
                                            {$v.text|html_entity_decode|strip_tags}
                                        </div>
                                    </div>
                                </td>
                                <td >{$v.create_time}</td>
                                <td style="color:{:config('examine')[$v.examine]['color']}">{:config('examine')[$v.examine]['name']}</td>
                                <td style="text-align:center;">
                                    <a href="/admin/title/edit/id/{$v.id}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                                    <a href="/admin/title/delete/id/{$v.id}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                                </td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->
                    {$title_list->render();}
                </div>
            </form>
        </div>
    </div>
</div>
{/block}